<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>图片上生成文本输出</title>
<load href="__PUBLIC__/Js/jquery.js"/>
</head>
<body>
	<span>图片上生成文本输出</span>
	<hr>
	<form action="/mytest/index.php/test/test3" method="post"  enctype="multipart/form-data">
		<span>背景图片：</span>
		<input type="file" name='bg'><br><br>
		
		<span>文本区域</span>&nbsp;<a href="javascript:addimg()">增加文本</a><br>
		
		<div class="mdiv" id="mdiv">
			<div class="iptdiv">
				<input type="text" name="text[]"  class="ipt" />
				&nbsp;<a href="#" name="rmlink">delete</a>
			</div><br>
		</div>
		
		
		<br>
		<input type="submit" value="生 成">
	
		
	</form>
	
	<script type="text/javascript">
        $(document).ready(function() {
            bindListener();
            
        })

        function addimg() {
            $("#mdiv").append(
                            '<div class="iptdiv" ><input type="text" name="text[]" class="ipt" />'+
                            '&nbsp;<a href="#" name="rmlink">delete</a></div><br>');
            //为新元素节点添加事件侦听器
            bindListener();
            
        }
        
        function bindListener(){
            $("a[name='rmlink']").unbind().click(function(){
                $(this).parent().remove();
            })
            
        }
    </script>
</body>
</html>